<%#include "tab.h" %>
<%
QString lang = httpRequest().cookie("lang");
QVariantMap qMap = httpRequest().queryItems();
QString tid = tId();

QString action = qMap.contains("action") ? httpRequest().queryItemValue("action"): variant("action").toString();
QString tabId = qMap.contains("tabId") ? httpRequest().queryItemValue("tabId"): variant("tabId").toString();
Tab tab = Tab::get(hmacVal(tabId).toInt());

QVariantMap qMapOut;
qMapOut.insert("tabId",tabId);
qMapOut.insert("action",action);
%>
<% if (action == "show"){ %>
<!-- show -->
<div id="formTab<%== tid %>" name="formTab" class="form" >
  <table class="layout-fixed" width="100%">
   <tr>
      <td style="text-align:right;white-space:nowrap"><%== UI("TABCD") %>:</td>
      <td><span style="padding-right:30px;" ><%== tab.tabCd() %></span></td>
      <td style="text-align:right;white-space:nowrap"><%== UI("TABNAMEZH") %>:</td>
      <td><span style="padding-right:30px;" ><%== tab.tabNameZh() %></span></td>
      <td style="text-align:right;white-space:nowrap"><%== UI("TABNAMEEN") %>:</td>
      <td><span style="padding-right:30px;" ><%== tab.tabNameEn() %></span></td>
   </tr>
   <tr>
      <td style="text-align:right;white-space:nowrap"><%== UI("TABTOOLTIP") %>:</td>
      <td colspan="5"><span style="padding-right:15px;" ><%== tab.tabTooltip() %></span></td>
   </tr>
   <tr>
      <td style="text-align:right;white-space:nowrap"><%== UI("TABDESC") %>:</td>
      <td colspan="5"><span style="padding-right:15px;" ><%== tab.tabDesc() %></span></td>
   </tr>
  </table>
</div>
<% }else { %>
<!-- edit -->
<div id="formTab<%== tid %>" name="formTab" class="form" action="/SystemUIsetting/<%== action %>Tab">
  <%== inputAuthenticityTag() %>
  <% if (action != "create") { %>
     <input name="tabId" class="mini-textbox" visible="false" value="<%== tabId %>"  /> 
  <% } %>
  <table style="width:100%">
   <tr>
      <td style="text-align:right;white-space:nowrap"><b><%== UI("TABCD") %></b>:</td>
      <td><input name="tabCd" class="mini-textbox" vtype="maxLength:64"  style="width:100%" value="<%== tab.tabCd() %>" /></td>
      <td style="text-align:right;white-space:nowrap"><b><%== UI("TABNAMEZH") %></b>:</td>
      <td><input name="tabNameZh" class="mini-textbox" vtype="maxLength:64" style="width:100%" value="<%== tab.tabNameZh() %>" /></td>
      <td style="text-align:right;white-space:nowrap"><b><%== UI("TABNAMEEN") %></b>:</td>
      <td><input name="tabNameEn" class="mini-textbox" vtype="maxLength:64" style="width:100%" value="<%== tab.tabNameEn() %>" /></td>
   </tr>
   <tr>
      <td style="text-align:right;white-space:nowrap"><%== UI("TABTOOLTIP") %>:</td>
      <td colspan="5"><input name="tabTooltip" class="mini-textarea" vtype="maxLength:256" style="width:100%" value="<%== tab.tabTooltip() %>" /></td>
   </tr>
   <tr>
      <td style="text-align:right;white-space:nowrap"><%== UI("TABDESC") %>:</td>
      <td colspan="5"><input name="tabDesc" class="mini-textarea" style="width:100%" value="<%== tab.tabDesc() %>" /></td>
   </tr>
  </table>
</div>
<% } %>
<!-- toolBar -->
<div class="mini-toolbar" style="border:0px">
</div>
<!-- tabs -->
<div class="mini-fit">
    <% if (action != "create") { %>
    <%== renderPartial("SystemUIsetting/relationOfTab",qMapOut) %> 
    <% } %>
</div>